    window.addEventListener('scroll', function() {
        const progressBar = document.getElementsByClassName("progressBar")[0];
        console.log(progressBar.style.width);
        const totalScrollHeight = document.documentElement.scrollHeight - document.documentElement.clientHeight;
        // console.log(totalScrollHeight);
        
        const currentScrollPosition = window.scrollY;
        // console.log(currentScrollPosition);  
        
        const scrollPercentage = (currentScrollPosition / totalScrollHeight) * 100;
        // console.log(scrollPercentage);
        
        // 更新进度条的宽度
        progressBar.style.width = `${scrollPercentage}%`;
      });